{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:54:02.588220Z",
     "start_time": "2018-08-03T04:54:02.580172Z"
    }
   },
   "outputs": [],
   "source": [
    "import gc, os\n",
    "from tqdm import tqdm\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import sys\n",
    "sys.path.append(f'/home/{os.environ.get(\"USER\")}/PythonLibrary')\n",
    "import lgbextension as ex\n",
    "import lightgbm as lgb\n",
    "from matplotlib import pyplot as plt\n",
    "from multiprocessing import cpu_count, Pool\n",
    "from sklearn.preprocessing import LabelEncoder\n",
    "from sklearn.model_selection import GroupKFold\n",
    "from glob import glob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:54:18.629036Z",
     "start_time": "2018-08-03T04:54:18.626789Z"
    }
   },
   "outputs": [],
   "source": [
    "NFOLD = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:19:21.567460Z",
     "start_time": "2018-08-03T04:19:16.016312Z"
    }
   },
   "outputs": [],
   "source": [
    "train = pd.read_csv('../input/application_train.csv.zip')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:19:30.714939Z",
     "start_time": "2018-08-03T04:19:21.568970Z"
    }
   },
   "outputs": [],
   "source": [
    "prev = pd.read_csv('../input/previous_application.csv.zip')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:19:30.809864Z",
     "start_time": "2018-08-03T04:19:30.716475Z"
    }
   },
   "outputs": [],
   "source": [
    "X_train, X_test = prev.align(train, join='inner', axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:35:38.991913Z",
     "start_time": "2018-08-03T04:35:38.960962Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>NAME_CONTRACT_TYPE</th>\n",
       "      <th>AMT_ANNUITY</th>\n",
       "      <th>AMT_CREDIT</th>\n",
       "      <th>AMT_GOODS_PRICE</th>\n",
       "      <th>WEEKDAY_APPR_PROCESS_START</th>\n",
       "      <th>HOUR_APPR_PROCESS_START</th>\n",
       "      <th>NAME_TYPE_SUITE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1730.430</td>\n",
       "      <td>17145.0</td>\n",
       "      <td>17145.0</td>\n",
       "      <td>2</td>\n",
       "      <td>15</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>25188.615</td>\n",
       "      <td>679671.0</td>\n",
       "      <td>607500.0</td>\n",
       "      <td>4</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>15060.735</td>\n",
       "      <td>136444.5</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>47041.335</td>\n",
       "      <td>470790.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>31924.395</td>\n",
       "      <td>404055.0</td>\n",
       "      <td>337500.0</td>\n",
       "      <td>4</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   NAME_CONTRACT_TYPE  AMT_ANNUITY  AMT_CREDIT  AMT_GOODS_PRICE  \\\n",
       "0                   1     1730.430     17145.0          17145.0   \n",
       "1                   0    25188.615    679671.0         607500.0   \n",
       "2                   0    15060.735    136444.5         112500.0   \n",
       "3                   0    47041.335    470790.0         450000.0   \n",
       "4                   0    31924.395    404055.0         337500.0   \n",
       "\n",
       "   WEEKDAY_APPR_PROCESS_START  HOUR_APPR_PROCESS_START  NAME_TYPE_SUITE  \n",
       "0                           2                       15                7  \n",
       "1                           4                       11                6  \n",
       "2                           5                       11                5  \n",
       "3                           1                        7                7  \n",
       "4                           4                        9                7  "
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.drop('SK_ID_CURR', axis=1, inplace=True)\n",
    "X_train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:19:30.911432Z",
     "start_time": "2018-08-03T04:19:30.842446Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>NAME_CONTRACT_TYPE</th>\n",
       "      <th>AMT_ANNUITY</th>\n",
       "      <th>AMT_CREDIT</th>\n",
       "      <th>AMT_GOODS_PRICE</th>\n",
       "      <th>WEEKDAY_APPR_PROCESS_START</th>\n",
       "      <th>HOUR_APPR_PROCESS_START</th>\n",
       "      <th>NAME_TYPE_SUITE</th>\n",
       "      <th>NAME_SELLER_INDUSTRY</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>271877</td>\n",
       "      <td>Consumer loans</td>\n",
       "      <td>1730.430</td>\n",
       "      <td>17145.0</td>\n",
       "      <td>17145.0</td>\n",
       "      <td>SATURDAY</td>\n",
       "      <td>15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Connectivity</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>108129</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>25188.615</td>\n",
       "      <td>679671.0</td>\n",
       "      <td>607500.0</td>\n",
       "      <td>THURSDAY</td>\n",
       "      <td>11</td>\n",
       "      <td>Unaccompanied</td>\n",
       "      <td>XNA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>122040</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>15060.735</td>\n",
       "      <td>136444.5</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>TUESDAY</td>\n",
       "      <td>11</td>\n",
       "      <td>Spouse, partner</td>\n",
       "      <td>XNA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>176158</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>47041.335</td>\n",
       "      <td>470790.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>MONDAY</td>\n",
       "      <td>7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XNA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>202054</td>\n",
       "      <td>Cash loans</td>\n",
       "      <td>31924.395</td>\n",
       "      <td>404055.0</td>\n",
       "      <td>337500.0</td>\n",
       "      <td>THURSDAY</td>\n",
       "      <td>9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XNA</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   SK_ID_CURR NAME_CONTRACT_TYPE  AMT_ANNUITY  AMT_CREDIT  AMT_GOODS_PRICE  \\\n",
       "0      271877     Consumer loans     1730.430     17145.0          17145.0   \n",
       "1      108129         Cash loans    25188.615    679671.0         607500.0   \n",
       "2      122040         Cash loans    15060.735    136444.5         112500.0   \n",
       "3      176158         Cash loans    47041.335    470790.0         450000.0   \n",
       "4      202054         Cash loans    31924.395    404055.0         337500.0   \n",
       "\n",
       "  WEEKDAY_APPR_PROCESS_START  HOUR_APPR_PROCESS_START  NAME_TYPE_SUITE  \\\n",
       "0                   SATURDAY                       15              NaN   \n",
       "1                   THURSDAY                       11    Unaccompanied   \n",
       "2                    TUESDAY                       11  Spouse, partner   \n",
       "3                     MONDAY                        7              NaN   \n",
       "4                   THURSDAY                        9              NaN   \n",
       "\n",
       "  NAME_SELLER_INDUSTRY  \n",
       "0         Connectivity  \n",
       "1                  XNA  \n",
       "2                  XNA  \n",
       "3                  XNA  \n",
       "4                  XNA  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prev[X_test.columns.tolist()+['NAME_SELLER_INDUSTRY']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:22:44.311860Z",
     "start_time": "2018-08-03T04:22:44.287111Z"
    }
   },
   "outputs": [],
   "source": [
    "col_cat = X_train.head().select_dtypes('O').columns.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:22:53.089329Z",
     "start_time": "2018-08-03T04:22:53.086404Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['NAME_CONTRACT_TYPE', 'WEEKDAY_APPR_PROCESS_START', 'NAME_TYPE_SUITE']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col_cat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:24:53.100309Z",
     "start_time": "2018-08-03T04:24:43.294555Z"
    }
   },
   "outputs": [],
   "source": [
    "le = LabelEncoder()\n",
    "for c in col_cat:\n",
    "    X_train[c].fillna('na dayo', inplace=True)\n",
    "    X_test[c].fillna('na dayo', inplace=True)\n",
    "    le.fit( X_train[c].append(X_test[c]) )\n",
    "    X_train[c] = le.transform(X_train[c])\n",
    "    X_test[c]  = le.transform(X_test[c])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:26:49.379827Z",
     "start_time": "2018-08-03T04:26:49.375738Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['AMT_APPLICATION',\n",
       " 'AMT_DOWN_PAYMENT',\n",
       " 'CHANNEL_TYPE',\n",
       " 'CNT_PAYMENT',\n",
       " 'CODE_REJECT_REASON',\n",
       " 'DAYS_DECISION',\n",
       " 'DAYS_FIRST_DRAWING',\n",
       " 'DAYS_FIRST_DUE',\n",
       " 'DAYS_LAST_DUE',\n",
       " 'DAYS_LAST_DUE_1ST_VERSION',\n",
       " 'DAYS_TERMINATION',\n",
       " 'FLAG_LAST_APPL_PER_CONTRACT',\n",
       " 'NAME_CASH_LOAN_PURPOSE',\n",
       " 'NAME_CLIENT_TYPE',\n",
       " 'NAME_CONTRACT_STATUS',\n",
       " 'NAME_GOODS_CATEGORY',\n",
       " 'NAME_PAYMENT_TYPE',\n",
       " 'NAME_PORTFOLIO',\n",
       " 'NAME_PRODUCT_TYPE',\n",
       " 'NAME_SELLER_INDUSTRY',\n",
       " 'NAME_YIELD_GROUP',\n",
       " 'NFLAG_INSURED_ON_APPROVAL',\n",
       " 'NFLAG_LAST_APPL_IN_DAY',\n",
       " 'PRODUCT_COMBINATION',\n",
       " 'RATE_DOWN_PAYMENT',\n",
       " 'RATE_INTEREST_PRIMARY',\n",
       " 'RATE_INTEREST_PRIVILEGED',\n",
       " 'SELLERPLACE_AREA',\n",
       " 'SK_ID_PREV']"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_names = prev.columns.difference(X_train.columns).tolist()\n",
    "y_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:32:09.348196Z",
     "start_time": "2018-08-03T04:32:09.007098Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AMT_APPLICATION                float64\n",
       "AMT_DOWN_PAYMENT               float64\n",
       "CHANNEL_TYPE                    object\n",
       "CNT_PAYMENT                    float64\n",
       "CODE_REJECT_REASON              object\n",
       "DAYS_DECISION                    int64\n",
       "DAYS_FIRST_DRAWING             float64\n",
       "DAYS_FIRST_DUE                 float64\n",
       "DAYS_LAST_DUE                  float64\n",
       "DAYS_LAST_DUE_1ST_VERSION      float64\n",
       "DAYS_TERMINATION               float64\n",
       "FLAG_LAST_APPL_PER_CONTRACT     object\n",
       "NAME_CASH_LOAN_PURPOSE          object\n",
       "NAME_CLIENT_TYPE                object\n",
       "NAME_CONTRACT_STATUS            object\n",
       "NAME_GOODS_CATEGORY             object\n",
       "NAME_PAYMENT_TYPE               object\n",
       "NAME_PORTFOLIO                  object\n",
       "NAME_PRODUCT_TYPE               object\n",
       "NAME_SELLER_INDUSTRY            object\n",
       "NAME_YIELD_GROUP                object\n",
       "NFLAG_INSURED_ON_APPROVAL      float64\n",
       "NFLAG_LAST_APPL_IN_DAY           int64\n",
       "PRODUCT_COMBINATION             object\n",
       "RATE_DOWN_PAYMENT              float64\n",
       "RATE_INTEREST_PRIMARY          float64\n",
       "RATE_INTEREST_PRIVILEGED       float64\n",
       "SELLERPLACE_AREA                 int64\n",
       "SK_ID_PREV                       int64\n",
       "dtype: object"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prev[y_names].dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:32:40.387214Z",
     "start_time": "2018-08-03T04:32:38.335931Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AMT_APPLICATION                      0\n",
       "AMT_DOWN_PAYMENT                895844\n",
       "CHANNEL_TYPE                         0\n",
       "CNT_PAYMENT                     372230\n",
       "CODE_REJECT_REASON                   0\n",
       "DAYS_DECISION                        0\n",
       "DAYS_FIRST_DRAWING              673065\n",
       "DAYS_FIRST_DUE                  673065\n",
       "DAYS_LAST_DUE                   673065\n",
       "DAYS_LAST_DUE_1ST_VERSION       673065\n",
       "DAYS_TERMINATION                673065\n",
       "FLAG_LAST_APPL_PER_CONTRACT          0\n",
       "NAME_CASH_LOAN_PURPOSE               0\n",
       "NAME_CLIENT_TYPE                     0\n",
       "NAME_CONTRACT_STATUS                 0\n",
       "NAME_GOODS_CATEGORY                  0\n",
       "NAME_PAYMENT_TYPE                    0\n",
       "NAME_PORTFOLIO                       0\n",
       "NAME_PRODUCT_TYPE                    0\n",
       "NAME_SELLER_INDUSTRY                 0\n",
       "NAME_YIELD_GROUP                     0\n",
       "NFLAG_INSURED_ON_APPROVAL       673065\n",
       "NFLAG_LAST_APPL_IN_DAY               0\n",
       "PRODUCT_COMBINATION                346\n",
       "RATE_DOWN_PAYMENT               895844\n",
       "RATE_INTEREST_PRIMARY          1664263\n",
       "RATE_INTEREST_PRIVILEGED       1664263\n",
       "SELLERPLACE_AREA                     0\n",
       "SK_ID_PREV                           0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prev[y_names].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:56:01.990849Z",
     "start_time": "2018-08-03T04:56:01.724399Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>AMT_APPLICATION</th>\n",
       "      <th>AMT_DOWN_PAYMENT</th>\n",
       "      <th>CHANNEL_TYPE</th>\n",
       "      <th>CNT_PAYMENT</th>\n",
       "      <th>CODE_REJECT_REASON</th>\n",
       "      <th>DAYS_DECISION</th>\n",
       "      <th>DAYS_FIRST_DRAWING</th>\n",
       "      <th>DAYS_FIRST_DUE</th>\n",
       "      <th>DAYS_LAST_DUE</th>\n",
       "      <th>DAYS_LAST_DUE_1ST_VERSION</th>\n",
       "      <th>...</th>\n",
       "      <th>NAME_SELLER_INDUSTRY</th>\n",
       "      <th>NAME_YIELD_GROUP</th>\n",
       "      <th>NFLAG_INSURED_ON_APPROVAL</th>\n",
       "      <th>NFLAG_LAST_APPL_IN_DAY</th>\n",
       "      <th>PRODUCT_COMBINATION</th>\n",
       "      <th>RATE_DOWN_PAYMENT</th>\n",
       "      <th>RATE_INTEREST_PRIMARY</th>\n",
       "      <th>RATE_INTEREST_PRIVILEGED</th>\n",
       "      <th>SELLERPLACE_AREA</th>\n",
       "      <th>SK_ID_PREV</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>17145.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-73</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-42.0</td>\n",
       "      <td>-42.0</td>\n",
       "      <td>300.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.182832</td>\n",
       "      <td>0.867336</td>\n",
       "      <td>35</td>\n",
       "      <td>2030495</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>607500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>36.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-164</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-134.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>916.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_action</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2802425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>112500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-301</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-271.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>59.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2523466</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>450000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-512</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-482.0</td>\n",
       "      <td>-182.0</td>\n",
       "      <td>-152.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2819243</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>337500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-781</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1784265</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 29 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   AMT_APPLICATION  AMT_DOWN_PAYMENT             CHANNEL_TYPE  CNT_PAYMENT  \\\n",
       "0          17145.0               0.0             Country-wide         12.0   \n",
       "1         607500.0               NaN           Contact center         36.0   \n",
       "2         112500.0               NaN  Credit and cash offices         12.0   \n",
       "3         450000.0               NaN  Credit and cash offices         12.0   \n",
       "4         337500.0               NaN  Credit and cash offices         24.0   \n",
       "\n",
       "  CODE_REJECT_REASON  DAYS_DECISION  DAYS_FIRST_DRAWING  DAYS_FIRST_DUE  \\\n",
       "0                XAP            -73            365243.0           -42.0   \n",
       "1                XAP           -164            365243.0          -134.0   \n",
       "2                XAP           -301            365243.0          -271.0   \n",
       "3                XAP           -512            365243.0          -482.0   \n",
       "4                 HC           -781                 NaN             NaN   \n",
       "\n",
       "   DAYS_LAST_DUE  DAYS_LAST_DUE_1ST_VERSION    ...      NAME_SELLER_INDUSTRY  \\\n",
       "0          -42.0                      300.0    ...              Connectivity   \n",
       "1       365243.0                      916.0    ...                       XNA   \n",
       "2       365243.0                       59.0    ...                       XNA   \n",
       "3         -182.0                     -152.0    ...                       XNA   \n",
       "4            NaN                        NaN    ...                       XNA   \n",
       "\n",
       "  NAME_YIELD_GROUP NFLAG_INSURED_ON_APPROVAL NFLAG_LAST_APPL_IN_DAY  \\\n",
       "0           middle                       0.0                      1   \n",
       "1       low_action                       1.0                      1   \n",
       "2             high                       1.0                      1   \n",
       "3           middle                       1.0                      1   \n",
       "4             high                       NaN                      1   \n",
       "\n",
       "        PRODUCT_COMBINATION RATE_DOWN_PAYMENT RATE_INTEREST_PRIMARY  \\\n",
       "0  POS mobile with interest               0.0              0.182832   \n",
       "1          Cash X-Sell: low               NaN                   NaN   \n",
       "2         Cash X-Sell: high               NaN                   NaN   \n",
       "3       Cash X-Sell: middle               NaN                   NaN   \n",
       "4         Cash Street: high               NaN                   NaN   \n",
       "\n",
       "  RATE_INTEREST_PRIVILEGED SELLERPLACE_AREA SK_ID_PREV  \n",
       "0                 0.867336               35    2030495  \n",
       "1                      NaN               -1    2802425  \n",
       "2                      NaN               -1    2523466  \n",
       "3                      NaN               -1    2819243  \n",
       "4                      NaN               -1    1784265  \n",
       "\n",
       "[5 rows x 29 columns]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prev[y_names].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:37:43.182852Z",
     "start_time": "2018-08-03T04:37:43.169888Z"
    }
   },
   "outputs": [],
   "source": [
    "SEED = 71\n",
    "\n",
    "param_bin = {\n",
    "         'objective': 'binary',\n",
    "         'metric': 'auc',\n",
    "         'learning_rate': 0.01,\n",
    "         \n",
    "         'max_depth': 6,\n",
    "         'num_leaves': 63,\n",
    "         'max_bin': 255,\n",
    "         \n",
    "         'min_child_weight': 10,\n",
    "         'min_data_in_leaf': 150,\n",
    "         'reg_lambda': 0.5,  # L2 regularization term on weights.\n",
    "         'reg_alpha': 0.5,  # L1 regularization term on weights.\n",
    "         \n",
    "         'colsample_bytree': 0.9,\n",
    "         'subsample': 0.9,\n",
    "#         'nthread': 32,\n",
    "         'nthread': cpu_count(),\n",
    "         'bagging_freq': 1,\n",
    "         'verbose':-1,\n",
    "         'seed': SEED\n",
    "         }\n",
    "\n",
    "\n",
    "param_reg = {\n",
    "         'objective': 'regression',\n",
    "         'metric': 'rmse',\n",
    "         'learning_rate': 0.01,\n",
    "         \n",
    "         'max_depth': 6,\n",
    "         'num_leaves': 63,\n",
    "         'max_bin': 255,\n",
    "         \n",
    "         'min_child_weight': 10,\n",
    "         'min_data_in_leaf': 150,\n",
    "         'reg_lambda': 0.5,  # L2 regularization term on weights.\n",
    "         'reg_alpha': 0.5,  # L1 regularization term on weights.\n",
    "         \n",
    "         'colsample_bytree': 0.9,\n",
    "         'subsample': 0.9,\n",
    "#         'nthread': 32,\n",
    "         'nthread': cpu_count(),\n",
    "         'bagging_freq': 1,\n",
    "         'verbose':-1,\n",
    "         'seed': SEED\n",
    "         }\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:54:26.499185Z",
     "start_time": "2018-08-03T04:54:25.859501Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:4: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "  after removing the cwd from sys.path.\n"
     ]
    }
   ],
   "source": [
    "group_kfold = GroupKFold(n_splits=NFOLD)\n",
    "\n",
    "sub_train = prev[['SK_ID_CURR']]\n",
    "sub_train['g'] = sub_train.SK_ID_CURR % NFOLD\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:32:55.009759Z",
     "start_time": "2018-08-03T04:32:55.007474Z"
    }
   },
   "outputs": [],
   "source": [
    "y_name = y_names[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:34:58.129888Z",
     "start_time": "2018-08-03T04:34:58.127451Z"
    }
   },
   "outputs": [],
   "source": [
    "y = prev[y_name]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:52:09.524440Z",
     "start_time": "2018-08-03T04:39:41.811012Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/lightgbm/basic.py:1040: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n",
      "/home/Kazuki/anaconda3/lib/python3.6/site-packages/lightgbm/basic.py:685: UserWarning: categorical_feature in param dict is overridden.\n",
      "  warnings.warn('categorical_feature in param dict is overridden.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[50]\tcv_agg's rmse: 3.07185 + 0.0027036\n",
      "[100]\tcv_agg's rmse: 1.86975 + 0.00164737\n",
      "[150]\tcv_agg's rmse: 1.1401 + 0.00104986\n",
      "[200]\tcv_agg's rmse: 0.694443 + 0.000834006\n",
      "[250]\tcv_agg's rmse: 0.424417 + 0.00116463\n",
      "[300]\tcv_agg's rmse: 0.261803 + 0.00196494\n",
      "[350]\tcv_agg's rmse: 0.165172 + 0.00318776\n",
      "[400]\tcv_agg's rmse: 0.107636 + 0.00497619\n",
      "[450]\tcv_agg's rmse: 0.0756826 + 0.00716195\n",
      "[500]\tcv_agg's rmse: 0.0583175 + 0.00938678\n",
      "[550]\tcv_agg's rmse: 0.0497306 + 0.0111414\n",
      "[600]\tcv_agg's rmse: 0.0457236 + 0.0122381\n",
      "[650]\tcv_agg's rmse: 0.0437599 + 0.012881\n",
      "[700]\tcv_agg's rmse: 0.0427608 + 0.0132542\n",
      "[750]\tcv_agg's rmse: 0.0422582 + 0.0134538\n",
      "[800]\tcv_agg's rmse: 0.0420215 + 0.0135494\n",
      "[850]\tcv_agg's rmse: 0.0418701 + 0.0136045\n",
      "[900]\tcv_agg's rmse: 0.0417752 + 0.0136433\n",
      "[950]\tcv_agg's rmse: 0.0416709 + 0.0136799\n",
      "[1000]\tcv_agg's rmse: 0.0415476 + 0.0137071\n",
      "[1050]\tcv_agg's rmse: 0.0414483 + 0.0137284\n",
      "[1100]\tcv_agg's rmse: 0.0413735 + 0.0137448\n",
      "[1150]\tcv_agg's rmse: 0.0413096 + 0.0137523\n",
      "[1200]\tcv_agg's rmse: 0.0412551 + 0.013768\n",
      "[1250]\tcv_agg's rmse: 0.0412072 + 0.0137805\n",
      "[1300]\tcv_agg's rmse: 0.0411668 + 0.0137879\n",
      "[1350]\tcv_agg's rmse: 0.0411228 + 0.0138011\n",
      "[1400]\tcv_agg's rmse: 0.041079 + 0.0138104\n",
      "[1450]\tcv_agg's rmse: 0.0410498 + 0.013812\n",
      "[1500]\tcv_agg's rmse: 0.0410189 + 0.0138191\n",
      "[1550]\tcv_agg's rmse: 0.0409943 + 0.0138167\n",
      "[1600]\tcv_agg's rmse: 0.040966 + 0.0138219\n",
      "[1650]\tcv_agg's rmse: 0.0409442 + 0.0138251\n",
      "[1700]\tcv_agg's rmse: 0.040924 + 0.0138256\n",
      "[1750]\tcv_agg's rmse: 0.0409079 + 0.0138318\n",
      "[1800]\tcv_agg's rmse: 0.0408952 + 0.0138332\n",
      "[1850]\tcv_agg's rmse: 0.0408816 + 0.0138354\n",
      "[1900]\tcv_agg's rmse: 0.0408602 + 0.0138358\n",
      "[1950]\tcv_agg's rmse: 0.0408479 + 0.0138394\n",
      "[2000]\tcv_agg's rmse: 0.0408322 + 0.0138415\n",
      "[2050]\tcv_agg's rmse: 0.0408232 + 0.0138365\n",
      "[2100]\tcv_agg's rmse: 0.0408124 + 0.0138413\n",
      "[2150]\tcv_agg's rmse: 0.0408006 + 0.0138429\n",
      "[2200]\tcv_agg's rmse: 0.0407939 + 0.0138405\n",
      "[2250]\tcv_agg's rmse: 0.040785 + 0.0138408\n",
      "[2300]\tcv_agg's rmse: 0.0407758 + 0.0138395\n",
      "[2350]\tcv_agg's rmse: 0.0407659 + 0.0138421\n",
      "[2400]\tcv_agg's rmse: 0.0407591 + 0.0138403\n",
      "[2450]\tcv_agg's rmse: 0.0407517 + 0.0138396\n",
      "[2500]\tcv_agg's rmse: 0.040741 + 0.013838\n",
      "[2550]\tcv_agg's rmse: 0.0407321 + 0.0138343\n",
      "[2600]\tcv_agg's rmse: 0.0407262 + 0.0138319\n",
      "[2650]\tcv_agg's rmse: 0.0407193 + 0.0138313\n",
      "[2700]\tcv_agg's rmse: 0.0407097 + 0.0138301\n",
      "[2750]\tcv_agg's rmse: 0.0407067 + 0.013829\n",
      "[2800]\tcv_agg's rmse: 0.0406998 + 0.0138261\n",
      "[2850]\tcv_agg's rmse: 0.0406908 + 0.0138264\n",
      "[2900]\tcv_agg's rmse: 0.0406847 + 0.0138293\n",
      "[2950]\tcv_agg's rmse: 0.0406785 + 0.0138261\n",
      "[3000]\tcv_agg's rmse: 0.0406715 + 0.013825\n",
      "[3050]\tcv_agg's rmse: 0.0406681 + 0.0138218\n",
      "[3100]\tcv_agg's rmse: 0.0406608 + 0.0138232\n",
      "[3150]\tcv_agg's rmse: 0.0406516 + 0.0138295\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-38-b5980842ee72>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      4\u001b[0m ret, models = lgb.cv(param_reg, dtrain, 99999, nfold=7, stratified=False,\n\u001b[1;32m      5\u001b[0m                      \u001b[0mearly_stopping_rounds\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m100\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mverbose_eval\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m50\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m                      seed=111)\n\u001b[0m",
      "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/lightgbm/engine.py\u001b[0m in \u001b[0;36mcv\u001b[0;34m(params, train_set, num_boost_round, folds, nfold, stratified, shuffle, metrics, fobj, feval, init_model, feature_name, categorical_feature, early_stopping_rounds, fpreproc, verbose_eval, show_stdv, seed, callbacks)\u001b[0m\n\u001b[1;32m    449\u001b[0m                                     \u001b[0mend_iteration\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnum_boost_round\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    450\u001b[0m                                     evaluation_result_list=None))\n\u001b[0;32m--> 451\u001b[0;31m         \u001b[0mcvfolds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupdate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfobj\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    452\u001b[0m         \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_agg_cv_result\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcvfolds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0meval_valid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfeval\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    453\u001b[0m         \u001b[0;32mfor\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmean\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstd\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mres\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/lightgbm/engine.py\u001b[0m in \u001b[0;36mhandlerFunction\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m    247\u001b[0m             \u001b[0mret\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    248\u001b[0m             \u001b[0;32mfor\u001b[0m \u001b[0mbooster\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mboosters\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 249\u001b[0;31m                 \u001b[0mret\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbooster\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    250\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mret\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    251\u001b[0m         \u001b[0;32mreturn\u001b[0m \u001b[0mhandlerFunction\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/lib/python3.6/site-packages/lightgbm/basic.py\u001b[0m in \u001b[0;36mupdate\u001b[0;34m(self, train_set, fobj)\u001b[0m\n\u001b[1;32m   1526\u001b[0m             _safe_call(_LIB.LGBM_BoosterUpdateOneIter(\n\u001b[1;32m   1527\u001b[0m                 \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1528\u001b[0;31m                 ctypes.byref(is_finished)))\n\u001b[0m\u001b[1;32m   1529\u001b[0m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__is_predicted_cur_iter\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;32mFalse\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0m_\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange_\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__num_dataset\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1530\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mis_finished\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalue\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "dtrain = lgb.Dataset(X_train, y.map(np.log1p), categorical_feature=col_cat )\n",
    "gc.collect()\n",
    "\n",
    "ret, models = lgb.cv(param_reg, dtrain, 99999, stratified=False,\n",
    "                     folds=group_kfold.split(X_train, y, \n",
    "                                                              sub_train['g']), \n",
    "                     early_stopping_rounds=100, verbose_eval=50,\n",
    "                     seed=111)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:34:35.673629Z",
     "start_time": "2018-08-03T04:34:35.662421Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SK_ID_CURR</th>\n",
       "      <th>NAME_CONTRACT_TYPE</th>\n",
       "      <th>AMT_ANNUITY</th>\n",
       "      <th>AMT_CREDIT</th>\n",
       "      <th>AMT_GOODS_PRICE</th>\n",
       "      <th>WEEKDAY_APPR_PROCESS_START</th>\n",
       "      <th>HOUR_APPR_PROCESS_START</th>\n",
       "      <th>NAME_TYPE_SUITE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>271877</td>\n",
       "      <td>1</td>\n",
       "      <td>1730.430</td>\n",
       "      <td>17145.0</td>\n",
       "      <td>17145.0</td>\n",
       "      <td>2</td>\n",
       "      <td>15</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>108129</td>\n",
       "      <td>0</td>\n",
       "      <td>25188.615</td>\n",
       "      <td>679671.0</td>\n",
       "      <td>607500.0</td>\n",
       "      <td>4</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>122040</td>\n",
       "      <td>0</td>\n",
       "      <td>15060.735</td>\n",
       "      <td>136444.5</td>\n",
       "      <td>112500.0</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>176158</td>\n",
       "      <td>0</td>\n",
       "      <td>47041.335</td>\n",
       "      <td>470790.0</td>\n",
       "      <td>450000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>202054</td>\n",
       "      <td>0</td>\n",
       "      <td>31924.395</td>\n",
       "      <td>404055.0</td>\n",
       "      <td>337500.0</td>\n",
       "      <td>4</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   SK_ID_CURR  NAME_CONTRACT_TYPE  AMT_ANNUITY  AMT_CREDIT  AMT_GOODS_PRICE  \\\n",
       "0      271877                   1     1730.430     17145.0          17145.0   \n",
       "1      108129                   0    25188.615    679671.0         607500.0   \n",
       "2      122040                   0    15060.735    136444.5         112500.0   \n",
       "3      176158                   0    47041.335    470790.0         450000.0   \n",
       "4      202054                   0    31924.395    404055.0         337500.0   \n",
       "\n",
       "   WEEKDAY_APPR_PROCESS_START  HOUR_APPR_PROCESS_START  NAME_TYPE_SUITE  \n",
       "0                           2                       15                7  \n",
       "1                           4                       11                6  \n",
       "2                           5                       11                5  \n",
       "3                           1                        7                7  \n",
       "4                           4                        9                7  "
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-08-03T04:34:49.920268Z",
     "start_time": "2018-08-03T04:34:49.127589Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>AMT_APPLICATION</th>\n",
       "      <th>AMT_DOWN_PAYMENT</th>\n",
       "      <th>CHANNEL_TYPE</th>\n",
       "      <th>CNT_PAYMENT</th>\n",
       "      <th>CODE_REJECT_REASON</th>\n",
       "      <th>DAYS_DECISION</th>\n",
       "      <th>DAYS_FIRST_DRAWING</th>\n",
       "      <th>DAYS_FIRST_DUE</th>\n",
       "      <th>DAYS_LAST_DUE</th>\n",
       "      <th>DAYS_LAST_DUE_1ST_VERSION</th>\n",
       "      <th>...</th>\n",
       "      <th>NAME_SELLER_INDUSTRY</th>\n",
       "      <th>NAME_YIELD_GROUP</th>\n",
       "      <th>NFLAG_INSURED_ON_APPROVAL</th>\n",
       "      <th>NFLAG_LAST_APPL_IN_DAY</th>\n",
       "      <th>PRODUCT_COMBINATION</th>\n",
       "      <th>RATE_DOWN_PAYMENT</th>\n",
       "      <th>RATE_INTEREST_PRIMARY</th>\n",
       "      <th>RATE_INTEREST_PRIVILEGED</th>\n",
       "      <th>SELLERPLACE_AREA</th>\n",
       "      <th>SK_ID_PREV</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>17145.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-73</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-42.0</td>\n",
       "      <td>-42.0</td>\n",
       "      <td>300.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.182832</td>\n",
       "      <td>0.867336</td>\n",
       "      <td>35</td>\n",
       "      <td>2030495</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>607500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>36.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-164</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-134.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>916.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_action</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2802425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>112500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-301</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-271.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>59.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2523466</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>450000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-512</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-482.0</td>\n",
       "      <td>-182.0</td>\n",
       "      <td>-152.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2819243</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>337500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-781</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1784265</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>315000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>18.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-684</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-654.0</td>\n",
       "      <td>-144.0</td>\n",
       "      <td>-144.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1383531</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2315218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-21</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1656711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-386</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2367563</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-57</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2579447</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>270000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>54.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-735</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-705.0</td>\n",
       "      <td>-345.0</td>\n",
       "      <td>885.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1715995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>211500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>30.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-815</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-785.0</td>\n",
       "      <td>-725.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2257824</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>148500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-860</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-830.0</td>\n",
       "      <td>-200.0</td>\n",
       "      <td>-140.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2330894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>53779.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>8.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-408</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-378.0</td>\n",
       "      <td>-168.0</td>\n",
       "      <td>-168.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>low_action</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS household without interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "      <td>1397919</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>26550.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>3.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-726</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-693.0</td>\n",
       "      <td>-633.0</td>\n",
       "      <td>-633.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS household with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>83</td>\n",
       "      <td>2273188</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>126490.5</td>\n",
       "      <td>12649.5</td>\n",
       "      <td>Regional / Local</td>\n",
       "      <td>6.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-699</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-668.0</td>\n",
       "      <td>-518.0</td>\n",
       "      <td>-518.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Industry</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS other with interest</td>\n",
       "      <td>0.103971</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>130</td>\n",
       "      <td>1232483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>26955.0</td>\n",
       "      <td>1350.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>8.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1473</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1440.0</td>\n",
       "      <td>-1230.0</td>\n",
       "      <td>-1230.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>high</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS household with interest</td>\n",
       "      <td>0.051324</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>130</td>\n",
       "      <td>2163253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>180000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>0.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-336</td>\n",
       "      <td>-277.0</td>\n",
       "      <td>-257.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Card X-Sell</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>1285768</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>180000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>24.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-700</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>2393109</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>45000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>18.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-584</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6</td>\n",
       "      <td>1173070</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>450000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-401</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1506815</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>405000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>30.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-686</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-656.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>214.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1182516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>HC</td>\n",
       "      <td>-239</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1172842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1129500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>54.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-594</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1172937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-202</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1555330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>229500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-370</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-340.0</td>\n",
       "      <td>-10.0</td>\n",
       "      <td>-10.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1543131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>369000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>48.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1487</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1457.0</td>\n",
       "      <td>-47.0</td>\n",
       "      <td>-47.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2536650</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>247500.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>18.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1883</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1853.0</td>\n",
       "      <td>-1343.0</td>\n",
       "      <td>-1343.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>high</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: high</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1676258</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>74610.0</td>\n",
       "      <td>9000.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-2702</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-2671.0</td>\n",
       "      <td>-2341.0</td>\n",
       "      <td>-2341.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.131374</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61</td>\n",
       "      <td>2075578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>NaN</td>\n",
       "      <td>HC</td>\n",
       "      <td>-430</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1583704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670184</th>\n",
       "      <td>1575000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>60.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1458393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670185</th>\n",
       "      <td>450000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>12.0</td>\n",
       "      <td>LIMIT</td>\n",
       "      <td>-622</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2815037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670186</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-21</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1433968</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670187</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-134</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1971628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670188</th>\n",
       "      <td>900000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>60.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-68</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1713281</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670189</th>\n",
       "      <td>796500.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>60.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-72</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2406354</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670190</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Contact center</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-243</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2381880</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670191</th>\n",
       "      <td>45000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Stone</td>\n",
       "      <td>0.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-499</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Card Street</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>150</td>\n",
       "      <td>1755809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670192</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>0.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-540</td>\n",
       "      <td>-474.0</td>\n",
       "      <td>-438.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Card X-Sell</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "      <td>2101747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670193</th>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>NaN</td>\n",
       "      <td>HC</td>\n",
       "      <td>-365</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Card Street</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "      <td>1120445</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670194</th>\n",
       "      <td>90000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-457</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-427.0</td>\n",
       "      <td>-97.0</td>\n",
       "      <td>-97.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10</td>\n",
       "      <td>2101748</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670195</th>\n",
       "      <td>248535.0</td>\n",
       "      <td>24853.5</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>10.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1389</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1354.0</td>\n",
       "      <td>-1084.0</td>\n",
       "      <td>-1084.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Furniture</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS industry with interest</td>\n",
       "      <td>0.108909</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80</td>\n",
       "      <td>2561520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670196</th>\n",
       "      <td>57910.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>NaN</td>\n",
       "      <td>CLIENT</td>\n",
       "      <td>-289</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>96</td>\n",
       "      <td>1662123</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670197</th>\n",
       "      <td>153220.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Regional / Local</td>\n",
       "      <td>12.0</td>\n",
       "      <td>LIMIT</td>\n",
       "      <td>-636</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>Construction</td>\n",
       "      <td>middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>POS industry with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>673</td>\n",
       "      <td>1854636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670198</th>\n",
       "      <td>22869.0</td>\n",
       "      <td>2290.5</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-715</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-684.0</td>\n",
       "      <td>-564.0</td>\n",
       "      <td>-354.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.109081</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>1540903</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670199</th>\n",
       "      <td>37926.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>6.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-6</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>high</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>1077969</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670200</th>\n",
       "      <td>99000.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>24.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-2439</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-2409.0</td>\n",
       "      <td>-1719.0</td>\n",
       "      <td>-1719.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>high</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>1024416</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670201</th>\n",
       "      <td>45450.0</td>\n",
       "      <td>2295.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1728</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1697.0</td>\n",
       "      <td>-1367.0</td>\n",
       "      <td>-1367.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Furniture</td>\n",
       "      <td>high</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS industry with interest</td>\n",
       "      <td>0.044300</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>220</td>\n",
       "      <td>1028905</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670202</th>\n",
       "      <td>22207.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>6.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-979</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-948.0</td>\n",
       "      <td>-858.0</td>\n",
       "      <td>-798.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Clothing</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS industry with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20</td>\n",
       "      <td>2205099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670203</th>\n",
       "      <td>14791.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>NaN</td>\n",
       "      <td>XNA</td>\n",
       "      <td>-1848</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>Connectivity</td>\n",
       "      <td>XNA</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>POS mobile with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>106</td>\n",
       "      <td>2844282</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670204</th>\n",
       "      <td>450000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>HC</td>\n",
       "      <td>-848</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>1407146</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670205</th>\n",
       "      <td>135000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>LIMIT</td>\n",
       "      <td>-1407</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>2815130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670206</th>\n",
       "      <td>180000.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>24.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1833</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1802.0</td>\n",
       "      <td>-1112.0</td>\n",
       "      <td>-1112.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>2459206</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670207</th>\n",
       "      <td>112500.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>12.0</td>\n",
       "      <td>SCO</td>\n",
       "      <td>-2514</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>high</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash Street: high</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>1662353</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670208</th>\n",
       "      <td>315000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Credit and cash offices</td>\n",
       "      <td>36.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1279</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1249.0</td>\n",
       "      <td>-919.0</td>\n",
       "      <td>-199.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "      <td>1556789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670209</th>\n",
       "      <td>267295.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>30.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-544</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-508.0</td>\n",
       "      <td>-358.0</td>\n",
       "      <td>362.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Furniture</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS industry with interest</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>43</td>\n",
       "      <td>2300464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670210</th>\n",
       "      <td>87750.0</td>\n",
       "      <td>29250.0</td>\n",
       "      <td>Stone</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1694</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1604.0</td>\n",
       "      <td>-1304.0</td>\n",
       "      <td>-1274.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Furniture</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS industry with interest</td>\n",
       "      <td>0.340554</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>43</td>\n",
       "      <td>2357031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670211</th>\n",
       "      <td>105237.0</td>\n",
       "      <td>10525.5</td>\n",
       "      <td>Country-wide</td>\n",
       "      <td>10.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1488</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1457.0</td>\n",
       "      <td>-1187.0</td>\n",
       "      <td>-1187.0</td>\n",
       "      <td>...</td>\n",
       "      <td>Consumer electronics</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>POS household with interest</td>\n",
       "      <td>0.101401</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1370</td>\n",
       "      <td>2659632</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670212</th>\n",
       "      <td>180000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>12.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1185</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1155.0</td>\n",
       "      <td>-825.0</td>\n",
       "      <td>-825.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>low_normal</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: low</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2785582</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1670213</th>\n",
       "      <td>360000.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>AP+ (Cash loan)</td>\n",
       "      <td>48.0</td>\n",
       "      <td>XAP</td>\n",
       "      <td>-1193</td>\n",
       "      <td>365243.0</td>\n",
       "      <td>-1163.0</td>\n",
       "      <td>-443.0</td>\n",
       "      <td>247.0</td>\n",
       "      <td>...</td>\n",
       "      <td>XNA</td>\n",
       "      <td>middle</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>Cash X-Sell: middle</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1</td>\n",
       "      <td>2418762</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1670214 rows × 29 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         AMT_APPLICATION  AMT_DOWN_PAYMENT             CHANNEL_TYPE  \\\n",
       "0                17145.0               0.0             Country-wide   \n",
       "1               607500.0               NaN           Contact center   \n",
       "2               112500.0               NaN  Credit and cash offices   \n",
       "3               450000.0               NaN  Credit and cash offices   \n",
       "4               337500.0               NaN  Credit and cash offices   \n",
       "5               315000.0               NaN  Credit and cash offices   \n",
       "6                    0.0               NaN  Credit and cash offices   \n",
       "7                    0.0               NaN  Credit and cash offices   \n",
       "8                    0.0               NaN  Credit and cash offices   \n",
       "9                    0.0               NaN  Credit and cash offices   \n",
       "10              270000.0               NaN  Credit and cash offices   \n",
       "11              211500.0               NaN  Credit and cash offices   \n",
       "12              148500.0               NaN  Credit and cash offices   \n",
       "13               53779.5               0.0             Country-wide   \n",
       "14               26550.0               0.0                    Stone   \n",
       "15              126490.5           12649.5         Regional / Local   \n",
       "16               26955.0            1350.0                    Stone   \n",
       "17              180000.0               NaN          AP+ (Cash loan)   \n",
       "18              180000.0               NaN          AP+ (Cash loan)   \n",
       "19               45000.0               NaN          AP+ (Cash loan)   \n",
       "20              450000.0               NaN  Credit and cash offices   \n",
       "21              405000.0               NaN  Credit and cash offices   \n",
       "22                   0.0               NaN  Credit and cash offices   \n",
       "23             1129500.0               NaN  Credit and cash offices   \n",
       "24                   0.0               NaN  Credit and cash offices   \n",
       "25              229500.0               NaN  Credit and cash offices   \n",
       "26              369000.0               NaN             Country-wide   \n",
       "27              247500.0               0.0             Country-wide   \n",
       "28               74610.0            9000.0                    Stone   \n",
       "29                   0.0               NaN  Credit and cash offices   \n",
       "...                  ...               ...                      ...   \n",
       "1670184        1575000.0               NaN           Contact center   \n",
       "1670185         450000.0               NaN           Contact center   \n",
       "1670186              0.0               NaN           Contact center   \n",
       "1670187              0.0               NaN           Contact center   \n",
       "1670188         900000.0               NaN           Contact center   \n",
       "1670189         796500.0               NaN           Contact center   \n",
       "1670190              0.0               NaN           Contact center   \n",
       "1670191          45000.0               NaN                    Stone   \n",
       "1670192              0.0               NaN          AP+ (Cash loan)   \n",
       "1670193              0.0               NaN          AP+ (Cash loan)   \n",
       "1670194          90000.0               NaN          AP+ (Cash loan)   \n",
       "1670195         248535.0           24853.5             Country-wide   \n",
       "1670196          57910.5               0.0             Country-wide   \n",
       "1670197         153220.5               0.0         Regional / Local   \n",
       "1670198          22869.0            2290.5             Country-wide   \n",
       "1670199          37926.0               0.0             Country-wide   \n",
       "1670200          99000.0               0.0             Country-wide   \n",
       "1670201          45450.0            2295.0                    Stone   \n",
       "1670202          22207.5               0.0                    Stone   \n",
       "1670203          14791.5               0.0                    Stone   \n",
       "1670204         450000.0               NaN  Credit and cash offices   \n",
       "1670205         135000.0               NaN  Credit and cash offices   \n",
       "1670206         180000.0               0.0  Credit and cash offices   \n",
       "1670207         112500.0               0.0  Credit and cash offices   \n",
       "1670208         315000.0               NaN  Credit and cash offices   \n",
       "1670209         267295.5               0.0                    Stone   \n",
       "1670210          87750.0           29250.0                    Stone   \n",
       "1670211         105237.0           10525.5             Country-wide   \n",
       "1670212         180000.0               NaN          AP+ (Cash loan)   \n",
       "1670213         360000.0               NaN          AP+ (Cash loan)   \n",
       "\n",
       "         CNT_PAYMENT CODE_REJECT_REASON  DAYS_DECISION  DAYS_FIRST_DRAWING  \\\n",
       "0               12.0                XAP            -73            365243.0   \n",
       "1               36.0                XAP           -164            365243.0   \n",
       "2               12.0                XAP           -301            365243.0   \n",
       "3               12.0                XAP           -512            365243.0   \n",
       "4               24.0                 HC           -781                 NaN   \n",
       "5               18.0                XAP           -684            365243.0   \n",
       "6                NaN                XAP            -14                 NaN   \n",
       "7                NaN                XAP            -21                 NaN   \n",
       "8                NaN                XAP           -386                 NaN   \n",
       "9                NaN                XAP            -57                 NaN   \n",
       "10              54.0                XAP           -735            365243.0   \n",
       "11              30.0                XAP           -815            365243.0   \n",
       "12              24.0                XAP           -860            365243.0   \n",
       "13               8.0                XAP           -408            365243.0   \n",
       "14               3.0                XAP           -726            365243.0   \n",
       "15               6.0                XAP           -699            365243.0   \n",
       "16               8.0                XAP          -1473            365243.0   \n",
       "17               0.0                XAP           -336              -277.0   \n",
       "18              24.0                XAP           -700                 NaN   \n",
       "19              18.0                 HC           -584                 NaN   \n",
       "20              24.0                 HC           -401                 NaN   \n",
       "21              30.0                XAP           -686            365243.0   \n",
       "22               NaN                 HC           -239                 NaN   \n",
       "23              54.0                 HC           -594                 NaN   \n",
       "24               NaN                XAP           -202                 NaN   \n",
       "25              12.0                XAP           -370            365243.0   \n",
       "26              48.0                XAP          -1487            365243.0   \n",
       "27              18.0                XAP          -1883            365243.0   \n",
       "28              12.0                XAP          -2702            365243.0   \n",
       "29               NaN                 HC           -430                 NaN   \n",
       "...              ...                ...            ...                 ...   \n",
       "1670184         60.0                 HC             -2                 NaN   \n",
       "1670185         12.0              LIMIT           -622                 NaN   \n",
       "1670186          NaN                XAP            -21                 NaN   \n",
       "1670187          NaN                XAP           -134                 NaN   \n",
       "1670188         60.0                XAP            -68                 NaN   \n",
       "1670189         60.0                XAP            -72                 NaN   \n",
       "1670190          NaN                XAP           -243                 NaN   \n",
       "1670191          0.0                 HC           -499                 NaN   \n",
       "1670192          0.0                XAP           -540              -474.0   \n",
       "1670193          NaN                 HC           -365                 NaN   \n",
       "1670194         12.0                XAP           -457            365243.0   \n",
       "1670195         10.0                XAP          -1389            365243.0   \n",
       "1670196          NaN             CLIENT           -289                 NaN   \n",
       "1670197         12.0              LIMIT           -636                 NaN   \n",
       "1670198         12.0                XAP           -715            365243.0   \n",
       "1670199          6.0                XAP             -6            365243.0   \n",
       "1670200         24.0                XAP          -2439            365243.0   \n",
       "1670201         12.0                XAP          -1728            365243.0   \n",
       "1670202          6.0                XAP           -979            365243.0   \n",
       "1670203          NaN                XNA          -1848                 NaN   \n",
       "1670204         24.0                 HC           -848                 NaN   \n",
       "1670205         24.0              LIMIT          -1407                 NaN   \n",
       "1670206         24.0                XAP          -1833            365243.0   \n",
       "1670207         12.0                SCO          -2514                 NaN   \n",
       "1670208         36.0                XAP          -1279            365243.0   \n",
       "1670209         30.0                XAP           -544            365243.0   \n",
       "1670210         12.0                XAP          -1694            365243.0   \n",
       "1670211         10.0                XAP          -1488            365243.0   \n",
       "1670212         12.0                XAP          -1185            365243.0   \n",
       "1670213         48.0                XAP          -1193            365243.0   \n",
       "\n",
       "         DAYS_FIRST_DUE  DAYS_LAST_DUE  DAYS_LAST_DUE_1ST_VERSION    ...      \\\n",
       "0                 -42.0          -42.0                      300.0    ...       \n",
       "1                -134.0       365243.0                      916.0    ...       \n",
       "2                -271.0       365243.0                       59.0    ...       \n",
       "3                -482.0         -182.0                     -152.0    ...       \n",
       "4                   NaN            NaN                        NaN    ...       \n",
       "5                -654.0         -144.0                     -144.0    ...       \n",
       "6                   NaN            NaN                        NaN    ...       \n",
       "7                   NaN            NaN                        NaN    ...       \n",
       "8                   NaN            NaN                        NaN    ...       \n",
       "9                   NaN            NaN                        NaN    ...       \n",
       "10               -705.0         -345.0                      885.0    ...       \n",
       "11               -785.0         -725.0                       85.0    ...       \n",
       "12               -830.0         -200.0                     -140.0    ...       \n",
       "13               -378.0         -168.0                     -168.0    ...       \n",
       "14               -693.0         -633.0                     -633.0    ...       \n",
       "15               -668.0         -518.0                     -518.0    ...       \n",
       "16              -1440.0        -1230.0                    -1230.0    ...       \n",
       "17               -257.0       365243.0                   365243.0    ...       \n",
       "18                  NaN            NaN                        NaN    ...       \n",
       "19                  NaN            NaN                        NaN    ...       \n",
       "20                  NaN            NaN                        NaN    ...       \n",
       "21               -656.0       365243.0                      214.0    ...       \n",
       "22                  NaN            NaN                        NaN    ...       \n",
       "23                  NaN            NaN                        NaN    ...       \n",
       "24                  NaN            NaN                        NaN    ...       \n",
       "25               -340.0          -10.0                      -10.0    ...       \n",
       "26              -1457.0          -47.0                      -47.0    ...       \n",
       "27              -1853.0        -1343.0                    -1343.0    ...       \n",
       "28              -2671.0        -2341.0                    -2341.0    ...       \n",
       "29                  NaN            NaN                        NaN    ...       \n",
       "...                 ...            ...                        ...    ...       \n",
       "1670184             NaN            NaN                        NaN    ...       \n",
       "1670185             NaN            NaN                        NaN    ...       \n",
       "1670186             NaN            NaN                        NaN    ...       \n",
       "1670187             NaN            NaN                        NaN    ...       \n",
       "1670188             NaN            NaN                        NaN    ...       \n",
       "1670189             NaN            NaN                        NaN    ...       \n",
       "1670190             NaN            NaN                        NaN    ...       \n",
       "1670191             NaN            NaN                        NaN    ...       \n",
       "1670192          -438.0       365243.0                   365243.0    ...       \n",
       "1670193             NaN            NaN                        NaN    ...       \n",
       "1670194          -427.0          -97.0                      -97.0    ...       \n",
       "1670195         -1354.0        -1084.0                    -1084.0    ...       \n",
       "1670196             NaN            NaN                        NaN    ...       \n",
       "1670197             NaN            NaN                        NaN    ...       \n",
       "1670198          -684.0         -564.0                     -354.0    ...       \n",
       "1670199        365243.0       365243.0                      174.0    ...       \n",
       "1670200         -2409.0        -1719.0                    -1719.0    ...       \n",
       "1670201         -1697.0        -1367.0                    -1367.0    ...       \n",
       "1670202          -948.0         -858.0                     -798.0    ...       \n",
       "1670203             NaN            NaN                        NaN    ...       \n",
       "1670204             NaN            NaN                        NaN    ...       \n",
       "1670205             NaN            NaN                        NaN    ...       \n",
       "1670206         -1802.0        -1112.0                    -1112.0    ...       \n",
       "1670207             NaN            NaN                        NaN    ...       \n",
       "1670208         -1249.0         -919.0                     -199.0    ...       \n",
       "1670209          -508.0         -358.0                      362.0    ...       \n",
       "1670210         -1604.0        -1304.0                    -1274.0    ...       \n",
       "1670211         -1457.0        -1187.0                    -1187.0    ...       \n",
       "1670212         -1155.0         -825.0                     -825.0    ...       \n",
       "1670213         -1163.0         -443.0                      247.0    ...       \n",
       "\n",
       "         NAME_SELLER_INDUSTRY NAME_YIELD_GROUP NFLAG_INSURED_ON_APPROVAL  \\\n",
       "0                Connectivity           middle                       0.0   \n",
       "1                         XNA       low_action                       1.0   \n",
       "2                         XNA             high                       1.0   \n",
       "3                         XNA           middle                       1.0   \n",
       "4                         XNA             high                       NaN   \n",
       "5                         XNA       low_normal                       1.0   \n",
       "6                         XNA              XNA                       NaN   \n",
       "7                         XNA              XNA                       NaN   \n",
       "8                         XNA              XNA                       NaN   \n",
       "9                         XNA              XNA                       NaN   \n",
       "10                        XNA       low_normal                       1.0   \n",
       "11                        XNA           middle                       1.0   \n",
       "12                        XNA             high                       1.0   \n",
       "13       Consumer electronics       low_action                       1.0   \n",
       "14       Consumer electronics           middle                       0.0   \n",
       "15                   Industry       low_normal                       0.0   \n",
       "16       Consumer electronics             high                       0.0   \n",
       "17                        XNA              XNA                       0.0   \n",
       "18                        XNA       low_normal                       NaN   \n",
       "19                        XNA             high                       NaN   \n",
       "20                        XNA       low_normal                       NaN   \n",
       "21                        XNA       low_normal                       1.0   \n",
       "22                        XNA              XNA                       NaN   \n",
       "23                        XNA       low_normal                       NaN   \n",
       "24                        XNA              XNA                       NaN   \n",
       "25                        XNA       low_normal                       1.0   \n",
       "26       Consumer electronics           middle                       0.0   \n",
       "27       Consumer electronics             high                       1.0   \n",
       "28               Connectivity       low_normal                       0.0   \n",
       "29                        XNA              XNA                       NaN   \n",
       "...                       ...              ...                       ...   \n",
       "1670184                   XNA       low_normal                       NaN   \n",
       "1670185                   XNA           middle                       NaN   \n",
       "1670186                   XNA              XNA                       NaN   \n",
       "1670187                   XNA              XNA                       NaN   \n",
       "1670188                   XNA       low_normal                       NaN   \n",
       "1670189                   XNA       low_normal                       NaN   \n",
       "1670190                   XNA              XNA                       NaN   \n",
       "1670191  Consumer electronics              XNA                       NaN   \n",
       "1670192                   XNA              XNA                       0.0   \n",
       "1670193                   XNA              XNA                       NaN   \n",
       "1670194                   XNA       low_normal                       1.0   \n",
       "1670195             Furniture       low_normal                       0.0   \n",
       "1670196          Connectivity              XNA                       NaN   \n",
       "1670197          Construction           middle                       NaN   \n",
       "1670198          Connectivity           middle                       0.0   \n",
       "1670199          Connectivity             high                       1.0   \n",
       "1670200  Consumer electronics             high                       1.0   \n",
       "1670201             Furniture             high                       0.0   \n",
       "1670202              Clothing           middle                       0.0   \n",
       "1670203          Connectivity              XNA                       NaN   \n",
       "1670204                   XNA           middle                       NaN   \n",
       "1670205                   XNA             high                       NaN   \n",
       "1670206                   XNA             high                       0.0   \n",
       "1670207                   XNA             high                       NaN   \n",
       "1670208                   XNA           middle                       1.0   \n",
       "1670209             Furniture       low_normal                       0.0   \n",
       "1670210             Furniture           middle                       0.0   \n",
       "1670211  Consumer electronics       low_normal                       0.0   \n",
       "1670212                   XNA       low_normal                       1.0   \n",
       "1670213                   XNA           middle                       0.0   \n",
       "\n",
       "        NFLAG_LAST_APPL_IN_DAY             PRODUCT_COMBINATION  \\\n",
       "0                            1        POS mobile with interest   \n",
       "1                            1                Cash X-Sell: low   \n",
       "2                            1               Cash X-Sell: high   \n",
       "3                            1             Cash X-Sell: middle   \n",
       "4                            1               Cash Street: high   \n",
       "5                            1                Cash X-Sell: low   \n",
       "6                            1                            Cash   \n",
       "7                            1                            Cash   \n",
       "8                            1                            Cash   \n",
       "9                            1                            Cash   \n",
       "10                           1                Cash X-Sell: low   \n",
       "11                           1             Cash X-Sell: middle   \n",
       "12                           1               Cash X-Sell: high   \n",
       "13                           1  POS household without interest   \n",
       "14                           1     POS household with interest   \n",
       "15                           1         POS other with interest   \n",
       "16                           1     POS household with interest   \n",
       "17                           1                     Card X-Sell   \n",
       "18                           1                Cash X-Sell: low   \n",
       "19                           1               Cash Street: high   \n",
       "20                           1                Cash X-Sell: low   \n",
       "21                           1                Cash X-Sell: low   \n",
       "22                           1                            Cash   \n",
       "23                           1                Cash X-Sell: low   \n",
       "24                           1                            Cash   \n",
       "25                           1                Cash X-Sell: low   \n",
       "26                           1             Cash X-Sell: middle   \n",
       "27                           1               Cash X-Sell: high   \n",
       "28                           1        POS mobile with interest   \n",
       "29                           1                            Cash   \n",
       "...                        ...                             ...   \n",
       "1670184                      1                Cash X-Sell: low   \n",
       "1670185                      1             Cash Street: middle   \n",
       "1670186                      1                            Cash   \n",
       "1670187                      1                            Cash   \n",
       "1670188                      1                Cash X-Sell: low   \n",
       "1670189                      1                Cash Street: low   \n",
       "1670190                      1                            Cash   \n",
       "1670191                      1                     Card Street   \n",
       "1670192                      1                     Card X-Sell   \n",
       "1670193                      1                     Card Street   \n",
       "1670194                      1                Cash X-Sell: low   \n",
       "1670195                      1      POS industry with interest   \n",
       "1670196                      1        POS mobile with interest   \n",
       "1670197                      1      POS industry with interest   \n",
       "1670198                      1        POS mobile with interest   \n",
       "1670199                      1        POS mobile with interest   \n",
       "1670200                      1               Cash Street: high   \n",
       "1670201                      1      POS industry with interest   \n",
       "1670202                      1      POS industry with interest   \n",
       "1670203                      1        POS mobile with interest   \n",
       "1670204                      1             Cash X-Sell: middle   \n",
       "1670205                      1               Cash Street: high   \n",
       "1670206                      1               Cash Street: high   \n",
       "1670207                      1               Cash Street: high   \n",
       "1670208                      1             Cash X-Sell: middle   \n",
       "1670209                      1      POS industry with interest   \n",
       "1670210                      1      POS industry with interest   \n",
       "1670211                      1     POS household with interest   \n",
       "1670212                      1                Cash X-Sell: low   \n",
       "1670213                      1             Cash X-Sell: middle   \n",
       "\n",
       "        RATE_DOWN_PAYMENT RATE_INTEREST_PRIMARY RATE_INTEREST_PRIVILEGED  \\\n",
       "0                0.000000              0.182832                 0.867336   \n",
       "1                     NaN                   NaN                      NaN   \n",
       "2                     NaN                   NaN                      NaN   \n",
       "3                     NaN                   NaN                      NaN   \n",
       "4                     NaN                   NaN                      NaN   \n",
       "5                     NaN                   NaN                      NaN   \n",
       "6                     NaN                   NaN                      NaN   \n",
       "7                     NaN                   NaN                      NaN   \n",
       "8                     NaN                   NaN                      NaN   \n",
       "9                     NaN                   NaN                      NaN   \n",
       "10                    NaN                   NaN                      NaN   \n",
       "11                    NaN                   NaN                      NaN   \n",
       "12                    NaN                   NaN                      NaN   \n",
       "13               0.000000                   NaN                      NaN   \n",
       "14               0.000000                   NaN                      NaN   \n",
       "15               0.103971                   NaN                      NaN   \n",
       "16               0.051324                   NaN                      NaN   \n",
       "17                    NaN                   NaN                      NaN   \n",
       "18                    NaN                   NaN                      NaN   \n",
       "19                    NaN                   NaN                      NaN   \n",
       "20                    NaN                   NaN                      NaN   \n",
       "21                    NaN                   NaN                      NaN   \n",
       "22                    NaN                   NaN                      NaN   \n",
       "23                    NaN                   NaN                      NaN   \n",
       "24                    NaN                   NaN                      NaN   \n",
       "25                    NaN                   NaN                      NaN   \n",
       "26                    NaN                   NaN                      NaN   \n",
       "27               0.000000                   NaN                      NaN   \n",
       "28               0.131374                   NaN                      NaN   \n",
       "29                    NaN                   NaN                      NaN   \n",
       "...                   ...                   ...                      ...   \n",
       "1670184               NaN                   NaN                      NaN   \n",
       "1670185               NaN                   NaN                      NaN   \n",
       "1670186               NaN                   NaN                      NaN   \n",
       "1670187               NaN                   NaN                      NaN   \n",
       "1670188               NaN                   NaN                      NaN   \n",
       "1670189               NaN                   NaN                      NaN   \n",
       "1670190               NaN                   NaN                      NaN   \n",
       "1670191               NaN                   NaN                      NaN   \n",
       "1670192               NaN                   NaN                      NaN   \n",
       "1670193               NaN                   NaN                      NaN   \n",
       "1670194               NaN                   NaN                      NaN   \n",
       "1670195          0.108909                   NaN                      NaN   \n",
       "1670196          0.000000                   NaN                      NaN   \n",
       "1670197          0.000000                   NaN                      NaN   \n",
       "1670198          0.109081                   NaN                      NaN   \n",
       "1670199          0.000000                   NaN                      NaN   \n",
       "1670200          0.000000                   NaN                      NaN   \n",
       "1670201          0.044300                   NaN                      NaN   \n",
       "1670202          0.000000                   NaN                      NaN   \n",
       "1670203          0.000000                   NaN                      NaN   \n",
       "1670204               NaN                   NaN                      NaN   \n",
       "1670205               NaN                   NaN                      NaN   \n",
       "1670206          0.000000                   NaN                      NaN   \n",
       "1670207          0.000000                   NaN                      NaN   \n",
       "1670208               NaN                   NaN                      NaN   \n",
       "1670209          0.000000                   NaN                      NaN   \n",
       "1670210          0.340554                   NaN                      NaN   \n",
       "1670211          0.101401                   NaN                      NaN   \n",
       "1670212               NaN                   NaN                      NaN   \n",
       "1670213               NaN                   NaN                      NaN   \n",
       "\n",
       "        SELLERPLACE_AREA SK_ID_PREV  \n",
       "0                     35    2030495  \n",
       "1                     -1    2802425  \n",
       "2                     -1    2523466  \n",
       "3                     -1    2819243  \n",
       "4                     -1    1784265  \n",
       "5                     -1    1383531  \n",
       "6                     -1    2315218  \n",
       "7                     -1    1656711  \n",
       "8                     -1    2367563  \n",
       "9                     -1    2579447  \n",
       "10                    -1    1715995  \n",
       "11                    -1    2257824  \n",
       "12                    -1    2330894  \n",
       "13                   200    1397919  \n",
       "14                    83    2273188  \n",
       "15                   130    1232483  \n",
       "16                   130    2163253  \n",
       "17                     6    1285768  \n",
       "18                     6    2393109  \n",
       "19                     6    1173070  \n",
       "20                    -1    1506815  \n",
       "21                    -1    1182516  \n",
       "22                    -1    1172842  \n",
       "23                    -1    1172937  \n",
       "24                    -1    1555330  \n",
       "25                    -1    1543131  \n",
       "26                    -1    2536650  \n",
       "27                    -1    1676258  \n",
       "28                    61    2075578  \n",
       "29                    -1    1583704  \n",
       "...                  ...        ...  \n",
       "1670184               -1    1458393  \n",
       "1670185               -1    2815037  \n",
       "1670186               -1    1433968  \n",
       "1670187               -1    1971628  \n",
       "1670188               -1    1713281  \n",
       "1670189               -1    2406354  \n",
       "1670190               -1    2381880  \n",
       "1670191              150    1755809  \n",
       "1670192               10    2101747  \n",
       "1670193               10    1120445  \n",
       "1670194               10    2101748  \n",
       "1670195               80    2561520  \n",
       "1670196               96    1662123  \n",
       "1670197              673    1854636  \n",
       "1670198              100    1540903  \n",
       "1670199              100    1077969  \n",
       "1670200               -1    1024416  \n",
       "1670201              220    1028905  \n",
       "1670202               20    2205099  \n",
       "1670203              106    2844282  \n",
       "1670204              100    1407146  \n",
       "1670205              100    2815130  \n",
       "1670206              100    2459206  \n",
       "1670207              100    1662353  \n",
       "1670208              100    1556789  \n",
       "1670209               43    2300464  \n",
       "1670210               43    2357031  \n",
       "1670211             1370    2659632  \n",
       "1670212               -1    2785582  \n",
       "1670213               -1    2418762  \n",
       "\n",
       "[1670214 rows x 29 columns]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
